﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class uploadar : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
	{
		SE6.User curUsr = SessionMan.GetLoginUser();
		if (curUsr == null)
			Response.Redirect("login.aspx");
		if (!Utility.Util.IsEmptyString((String)Request.Form["name"]))
		{
			if (!SessionMan.ValidateCheckCode(Request.Form["checkCode"]))
			{
				feedBack.Text = "请输入正确的验证码！";
			}
			else
			{
				String upResult = ArchiveMan.Upload(Request);
				if (upResult == "")
				{
					SessionMan.SaveResult("您的档案上传成功！回到<a href='Default.aspx'>首页</a>！");
					Response.Redirect("Result.aspx");
				}
				else
					feedBack.Text = upResult;
			}
		}
		else
		{
			if (!curUsr.CanUploadArchive())
				feedBack.Text =
					"温馨提示：您目前尚缺上传档案的权限，故此页面仅供观赏，有意见请联系管理员。";
		}
		navMenu.InnerHtml = GUI.NavMenu(PageClass.UploadArchive);
	}
}
